package com.ehi.common.jersey.status;

import com.fasterxml.jackson.databind.annotation.JsonSerialize;

import javax.xml.bind.annotation.XmlRootElement;
import java.io.Serializable;

@XmlRootElement
public class ErrorMessage implements Serializable {

    private static final long serialVersionUID = 746111062708504016L;

    private ResponseTypeCode type;

    private String message;

    @JsonSerialize(include = JsonSerialize.Inclusion.NON_NULL)
    private String errorType;

    public ErrorMessage() {
    }

    public ErrorMessage(ResponseTypeCode status, String message) {
        this.type = status;
        this.message = message;
    }

    public ErrorMessage(ResponseTypeCode type, String message, String errorType) {
        this.type = type;
        this.message = message;
        this.errorType = errorType;
    }

    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }

    public ResponseTypeCode getType() {
        return type;
    }

    public void setType(ResponseTypeCode type) {
        this.type = type;
    }

    public String getErrorType() {
        return errorType;
    }

    public void setErrorType(String errorType) {
        this.errorType = errorType;
    }
}
